package wxy;

public class Week1_1_2_defangIPaddr {

    public String defangIPaddr(String address) {
        StringBuilder sb = new StringBuilder();
        int n = address.length();
        for (int i = 0; i < n; i++) {
            char c = address.charAt(i);
            if (c >= '0' && c <= '9') {
                sb.append(c);
            }else{
                sb.append("[.]");
            }
        }
        return sb.toString();
    }
}
